home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / amac34.arc / SR.BAT < prev    next >
DOS Batch File  |  1991-02-16  |  845b  |  45 lines

  1. @echo off
  2. rem SR.BAT for NON-case sensitive search/replace        Sat  02-16-1991
  3.  
  4. rem Requires FGREP.COM
  5. rem Requires INPUT.COM
  6. rem "Enter" without any search or replace text terminates batch file
  7.  
  8. CLS
  9. INPUT Search Text=/b
  10.      IF Errorlevel=1 goto END
  11. SET  FGS=%ANS%
  12. ECHO 
  13. INPUT Replacement Text=/b
  14.      IF Errorlevel=1 goto END
  15. SET  FGR=%ANS%
  16. SET >c:$
  17.  
  18. ECHO 
  19. ECHO Searching For Files Containing '%FGS%' To Replace With '%FGR%'...
  20. ECHO ******** NON-CASE SENSITIVE SEARCH/REPLACE ********
  21. ECHO 
  22. BREAK on
  23.  
  24. if not exist SRCH-FG.LST   GOTO NEXT1
  25. GOTO NEXT2
  26.  
  27. :NEXT1
  28. FGREP  -f /%FGS%/ *.*         >c:$.ql
  29.  
  30. :NEXT2
  31. if exist SRCH-FG.LST GOTO NEXT3
  32. GOTO NEXT4
  33.  
  34. :NEXT3
  35. FGREP -f /%FGS%/ @SRCH-FG.LST >c:$.ql
  36.  
  37. :NEXT4
  38.  
  39. BREAK off
  40. ECHO 
  41. COPY c:$.ql c:!
  42. Q.EXE       c:!    /ESRCH22.mac  /LSRCH22.mac
  43. ECHO 
  44. :END
  45.